class Person:  # 默认继承了object类
    def __init__(self, name, age):
        self.name = name
        self.age = age

    def show(self):
        print(f'我叫:{self.name},我今年:{self.age}岁了')


class Student(Person):
    def __init__(self, name, age, stuno):
        # 调用父类的初始化方法
        super().__init__(name, age)
        self.stuno = stuno  # 给自己特有的属性赋值

    # 重写父类的方法
    def show(self):
        super().show()
        print(f'学生的学号是:{self.stuno}')


class Doctor(Person):
    def __init__(self, name, age, department):
        # 调用父类的初始化方法
        Person.__init__(self, name, age)
        self.department = department  # 给自己特有的属性赋值

    def show(self):
        # 重新编写代码实现方法
        print(f'大家好,我叫:{self.name},我今年:{self.age}岁了,工作室是:{self.department}')

if __name__ == '__main__':
    stu = Student('duiduo', 18, 'msb1001')
    stu.show()
    doctor = Doctor('张一', 32, '外科')
    doctor.show()
